package com.service.impl;



import com.dao.UserDao;
import com.domain.User;
import com.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @BelongsPackage: com.hq1.javaweb.service.impl
 * @Author: jiangjunjie
 * @CreateTime: 2025-02-17  23:45
 * @Description: TODO
 * @Version: 1.8
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {
      @Resource
      UserDao userDao;
    @Override
    public List<User> getUserList() {
        List<User> userList=userDao.getAllUser();
        return userList;
    }
    @Override
    public int delUserById(int id) {
        return userDao.delUser(id);
    }

    @Override
    public User getUserByIds(int id) {
        User user = userDao.getUserById(id);
        return user;
    }

    @Override
    public int updateUser(User user) {
        int i = userDao.updateUser(user);
        return i;
    }

    @Override
    public int addUser(User user) {
        int i = userDao.addUser(user);
        return i;
    }
}
